package com.ss.android.article.browser.a;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.support.annotation.NonNull;

import com.a.a.NightMode;
import com.a.a.u;

import java.io.File;

import inline.BitmapDemo;

public final class c implements NightMode {
    private final a c;
    private final String a;
    private final String b;

    public c(a arg1, String arg2, String arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void f(@NonNull Object arg4) {
        Uri v0 = android.support.design.a.t(this.a);
        if(v0 == null) {
            ((u)arg4).onItem(BitmapDemo.a(this.c.a(this.b)));
            ((u)arg4).onComplete();
        }
        else {
            File v1 = com.ss.android.article.browser.a.a.a(com.ss.android.article.browser.a.a.a(this.c), v0);
            Bitmap v0_1 = com.ss.android.article.browser.a.a.a(this.c, this.a);
            if((v1.exists()) && v0_1 == null) {
                v0_1 = BitmapFactory.decodeFile(v1.getPath(), com.ss.android.article.browser.a.a.b(this.c));
                if(v0_1 != null) {
                    com.ss.android.article.browser.a.a.a(this.c, this.a, v0_1);
                }
            }

            if(v0_1 != null) {
                ((u)arg4).onItem(BitmapDemo.a(v0_1));
                ((u)arg4).onComplete();
                return;
            }

            ((u)arg4).onItem(BitmapDemo.a(this.c.a(this.b)));
            ((u)arg4).onComplete();
        }
    }
}

